package cn.ulegal.xudy.Controler;

import cn.ulegal.xudy.Service.TestService;
import cn.ulegal.xudy.entity.TestModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Ulegal on 2017/8/18.
 */

@RestController
public class TestControler {

      @Autowired
      private TestService testService;

      @Autowired
      private TestModel testModel;




    @RequestMapping(value = "/login")
    public String  saveCuringEvidence(HttpServletRequest request,HttpServletResponse response){
           testModel.setId(2);
           testModel.setName("xx");
          System.out.println("TestControler---------------------username:"+request.getParameter("username"));
        System.out.println("TestControler---------------------password:"+request.getParameter("password"));
//        CuzUsernamePasswordAuthenticationFilter filter=new CuzUsernamePasswordAuthenticationFilter();
//        filter.attemptAuthentication(request,response);
      testService.saveOidInfo(testModel);
         return request.getParameter("username");
    }






}
